#!/bin/bash

if [ "$1" = "" ]
then
    echo "Informe diretorio"
    exit
fi

if [ ! -d "$1/out" ]
then
    mkdir -p "$1/out"
else
    rm "$1/out/*"
fi

for i in $(seq 0 20)
do
    if [ $i -lt 10 ]
    then
        i="0"$i
    fi

    f="$1/in/$i.java"

    echo "Running $f"
    ./run.sh < $f > "$1/out/$i.out"
done

